package com.atguigu.spyx.model.exception;

import com.atguigu.spyx.model.common.ResultCodeEnum;
import lombok.Data;

/**
 * @author LT
 * @create 2023-11-01-19:03
 */
@Data
public class SpzxException extends RuntimeException{

    private Integer code;
    private String message;
    private Throwable e;

    public SpzxException(ResultCodeEnum resultCodeEnum, Throwable e) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
        this.e = e;
    }

    public SpzxException(Integer code, String message, Throwable e) {
        super(message);
        this.code = code;
        this.message = message;
        this.e = e;
    }
}
